﻿<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                              xmlns:rss="http://purl.org/rss/1.0/"
                              xmlns:dc="http://purl.org/dc/elements/1.1/"
                              xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">    
    <xsl:template match="rdf:RDF">
        <xsl:apply-templates select="rss:item" />
    </xsl:template>
    <xsl:template match="rss:item">
        <xsl:if test="position() &lt;= 20">
            <xsl:element name="menuitem">
                <xsl:attribute name="label">
                    <xsl:value-of select="rss:title" />
                </xsl:attribute>  
                <xsl:attribute name="tooltiptext">
                    <xsl:value-of select="concat('Автор: ', dc:creator)" />
                </xsl:attribute>
                <xsl:attribute name="id">
                    <xsl:value-of select="concat('vingradmenu-tb-news-item-',position ())" />
                </xsl:attribute>
               <xsl:attribute name="oncommand">
                    <xsl:value-of select="concat('navigator.page(&quot;',rss:link,'&quot;); event.stopPropagation();')" />
                </xsl:attribute>
            </xsl:element>
        </xsl:if>
    </xsl:template>
</xsl:stylesheet>
